package com.itheima.day02;

import java.util.concurrent.atomic.AtomicInteger;

public class Demo03 {
    public static void main(String[] args) {
        AtomicInteger ac1=new AtomicInteger(10);
        System.out.println(ac1.getAndIncrement());
        System.out.println(ac1.incrementAndGet());
        System.out.println(ac1);
        System.out.println(ac1.addAndGet(10));
        System.out.println(ac1.getAndAdd(10));
        System.out.println(ac1.getAndSet(10));
        System.out.println(ac1.compareAndSet(10, 20));
        System.out.println(ac1);
    }
}
